<template>
  <div class="loading">
    <span class="icon_loading iconEle"></span>
    <span v-if="showTip">{{content}}</span>
  </div>
</template>

<script>
  export default {
    name: 'loading',
    props: {
      showTip: false,
      content: {
        type: String,
        default: '正在加载中。。。'
      }
    }
  }
</script>

<style lang="scss" scoped>
  .loading{
    text-align: center;
    z-index: 11;
    .iconEle {
      font-size: 2rem;
    }
    .icon_loading::after {
      display: inline-block;
      font-family: 'iconfont';
      text-rendering: optimizeLegibility;
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
      content: "\e63d";
      -webkit-animation: loadingCircle 1s infinite linear;
      animation: loadingCircle 1s infinite linear;
    }
    .iconBack{
      background: rgba(0,0,0, 0.7);
      border-radius: 5px;
      color: #fff;
      padding: 0 0.4rem 0.1rem 0.4rem;
    }
    @keyframes loadingCircle {
      0% {
        transform-origin: 50% 50%;
        transform: rotate(0deg);
      }
      100% {
        transform-origin: 50% 50%;
        transform: rotate(360deg);
      }
    }
  }
</style>
